import request from '@/utils/request'

// 查询商品商品列表
export function listProductSpec(query) {
    return request({
        url: '/product/productSpec/list',
        method: 'get',
        params: query
    })
}
// 获取级联分类选项
export function getCategoryCascader() {
    return request({
        url: '/product/category/cascader',
        method: 'get'
    })
}
// 查询商品规格详细
export function getProductSpec(ProductSpecId) {
    return request({
        url: '/product/productSpec/' + ProductSpecId,
        method: 'get'
    })
}
// 新增商品规格
export function addProductSpec(data) {
    return request({
        url: '/product/productSpec',
        method: 'post',
        data: data
    })
}

// 修改商品规格
export function updateProductSpec(data) {
    return request({
        url: '/product/productSpec',
        method: 'put',
        data: data
    })
}
// 删除商品规格
export function delProductSpec(ids) {
    return request({
        url: '/product/productSpec/' + ids.join(','),
        method: 'delete'
    })
}
// 根据分类id商品规格
export function listByCategoryId(categoryId) {
    return request({
        url: '/product/productSpec/productSpec/' + categoryId,
        method: 'get'
    })
}